package com.hucii.app.net;



public class NetTask {
	public static final byte		METHOD_GET				= 0;
	public static final byte		METHOD_POST				= 1;

	public static final byte		TASK_STATUS_CREATED		= 0;		// 任务创建
	public static final byte		TASK_STATUS_STARTED		= 1;		// 开始接受数据
	public static final byte		TASK_STATUS_PROGRESS	= 2;		// 任务进度中
	public static final byte		TASK_STATUS_COMPLETED	= 3;		// 任务完成
	public static final byte		TASK_STATUS_TIMEOUT		= 4;		// 任务超时
	public static final byte		TASK_STATUS_FAILED		= 5;		// 任务失败
	public static final byte		TASK_STATUS_CANCELED	= 6;		// 任务取消

	protected RequestEntity			mRequestEntity;

	protected IAgentRequest			mAgentRequest;

	public byte						mTaskType;							// 任务类型
	public byte						mStatus;							// 任务状态
	
	public NetTask() {
		mStatus = TASK_STATUS_CREATED;
	}
	
	public byte getStatus() {
		return this.mStatus;
	}

	public RequestEntity getRequestEntity() {
		return mRequestEntity;
	}

	public int getApn() {
		if (mAgentRequest != null)
			return mAgentRequest.getApn();
		else
			return Apn.TYPE_UNKNOWN;
	}

	public IAgentRequest getAgentRequest() {
		return mAgentRequest;
	}

}
